package myJs.myPkg.cytoscape

import myJs.myPkg.jquery.JQuery
import org.scalajs.dom.{Element, Event}
import slinky.readwrite.ObjectOrWritten

import scala.scalajs.js
import scala.scalajs.js.annotation.JSImport

/**
 * Created by yz on 14/12/2020
 */

case class CytoscapeOptions(
                             container: Element,
                             minZoom: Double,
                             maxZoom: Double,
                             wheelSensitivity: Double,
                             elements: Elements,
                             layout: Layout,
                             style: List[Style],
                           )

@JSImport("cytoscape", JSImport.Namespace)
@js.native
object Cytoscape extends js.Object {

  def apply(options: ObjectOrWritten[CytoscapeOptions]): CytoscapeElement = js.native

}

@js.native
trait CytoscapeElement extends js.Object {

  def unbind(event: String): Unit = js.native

  def bind(event: String, handler: js.Function1[Event, Any]): Unit = js.native

  def edges(): JQuery = js.native

  def edges(selector: String): JQuery = js.native

  def group(): String = js.native

  def id(): String = js.native

}
